package larpplanner.logic;

import java.util.Map;

import larpplanner.database.DBCol;
import larpplanner.database.DBTable;
import larpplanner.database.FicCharacter;
import larpplanner.database.Player;
import larpplanner.database.Quest;

/**
 * A class holding the information about the quest in the Quest Selection Window.
 */
@DBTable("quest_summary")
public class QuestSummary extends Quest{

	public static final String NUMPARTICIPANTS_COL = "num_of_participants";
	
	//override fields so they will not load on get query
    protected String location;
    protected String details;
    protected Map<Player, FicCharacter> participants;
    
    //new field for quest summary
    @DBCol(NUMPARTICIPANTS_COL)
    public long numOfParticipants;

    public QuestSummary() {};
    
    public QuestSummary(Quest quest) {
    	id = quest.getId();
    	name = quest.getName();
    	date = quest.getDate();
    	numOfParticipants = quest.getParticipants().size();
    }
    
	public int getNumOfParticipants() {
	        return (int)numOfParticipants;
	}
	
	public String getFullRepresentitiveString() {
		return super.getFullRepresentitiveString() + " " + numOfParticipants;
	}

}
